
#ifndef _EEPROM_H_
#define _EEPROM_H_

extern uint8_t sensor_save_cnt;
extern void eeprom_init(void);
extern void eeprom_write(uint8_t addr, uint8_t  dat);
extern uint8_t eeprom_read(uint8_t  addr);
extern void eeprom_readtime(uint16_t cnt);
extern void eeprom_savetime(uint16_t channel);
extern void eeprom_clear_data(void);

#define EE_ADDR_CNT      0   // data counter, 1bytes
#define EE_ADDR_YEAR     2   // year , 1byte
#define EE_HEAD_LENGTH   4   // 1+2

#define DATA_SIZE   6   // channel, month, day, hours, minutes, seconds

#endif
